package ysq.xyg.web.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 业务模块-会员实体类
 *
 * @author shengQiang yu
 * @date 2019-4-26 13:51:56
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_member")
public class WebMember implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 卡号
     */ 
	@Column(name = "card_no")
	private String cardNo;
	
	/**
     * 微信openid
     */ 
	@Column(name = "openid")
	private String openid;
	
	/**
     * 昵称
     */ 
	@Column(name = "nick_name")
	private String nickName;
	
	/**
     * 头像
     */ 
	@Column(name = "head_image")
	private String headImage;
	
	/**
     * 手机号
     */ 
	@Column(name = "phone")
	private String phone;
	
	/**
     * 姓名
     */ 
	@Column(name = "name")
	private String name;
	
	/**
     * 余额
     */ 
	@Column(name = "money")
	private double money;
	
	/**
     * unionid标识
     */ 
	@Column(name = "unionid")
	private String unionid;
	
	/**
     * 一级推荐人卡号
     */ 
	@Column(name = "one_card_no")
	private String oneCardNo;
	
	/**
     * 二级推荐人卡号
     */ 
	@Column(name = "two_card_no")
	private String twoCardNo;
	
	/**
     * 区域推荐人卡号
     */ 
	@Column(name = "area_card_no")
	private String areaCardNo;
	
	/**
     * 用户级别
     */ 
	@Column(name = "grade")
	private String grade;

	/**
	 * 银行卡号
	 */
	@Column(name = "bank_no")
	private String bankNo;
	
	/**
     * 积分
     */ 
	@Column(name = "score")
	private int score;


	/**
     * 删除标注:1、正常，2、删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	@Transient
	private String startDate;

	@Transient
	private String endDate;


	public WebMember(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}